﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CNKI.TPI.Web.Search.Model;
using System.Collections;
using CNKI.TPI.Web.Base;

namespace CNKI.TPI.Web.Search.IBLL
{
    /// <summary>
    /// 导航信息Service
    /// </summary>
    public interface INaviService
    {
        /// <summary>
        /// 获得导航分类列表
        /// </summary>
        /// <param name="DBName">数据库编码</param>
        /// <param name="DBID">数据库ID</param>
        /// <returns>分类列表</returns>
        IList<CLS> GetCategoryType(string DBName, int DBID);

        /// <summary>
        /// 获得导航明细
        /// </summary>
        /// <param name="DBName">数据库编码</param>
        /// <param name="categoryType">分类ID</param>
        /// <param name="DBID">数据库ID</param>
        /// <returns>导航明细</returns>
        IList<CLS_NODE> GetCategoryList(string DBName, int categoryType, int DBID);

        /// <summary>
        /// 获得所有导航明细 后台设置导航编码使用
        /// </summary>
        /// <param name="DBName">数据库编码</param>
        /// <param name="categoryType">分类ID</param>
        /// <param name="DBID">数据库ID</param>
        /// <returns>导航明细</returns>
        IList<CLS_NODE> GetCategoryAllList(string DBName, int categoryType, int DBID);

        /// <summary>
        /// 获得指定节点的子节点列表
        /// </summary>
        /// <param name="DBName">数据库编码</param>
        /// <param name="categoryType">分类ID</param>
        /// <param name="code">导航编码</param>
        /// <param name="DBID">数据库ID</param>
        /// <returns>导航子列表</returns>
        IList<CLS_NODE> GetChildrenCategoryList(string DBName, int categoryType, string code, int DBID);

        /// <summary>
        /// 获得文献库列表
        /// </summary>
        /// <returns>文献库列表</returns>
        IList<SYS_CMS_DATABASE_CLS_NODE> GetDataBaseList(PermissionOption option = PermissionOption.FilteringPermissions);

        /// <summary>
        /// 获得多媒体库列表
        /// </summary>
        /// <returns>多媒体库列表</returns>
        IList<SYS_CMS_PUBLISHTYPE> GetMediaResourceList();
        /// <summary>
        /// 删除导航分类
        /// </summary>
        /// <param name="sysid"></param>
        /// <param name="dbCode"></param>
        /// <returns></returns>
        bool DelCLS(int sysid, string dbCode);
        /// <summary>
        /// 删除分类
        /// </summary>
        /// <param name="sysid"></param>
        /// <param name="dbCode"></param>
        /// <returns></returns>
        bool DelCLS_Node(int sysid, string dbCode);
        /// <summary>
        /// 插入导航分类列表
        /// </summary>
        /// <param name="dbCode"></param>
        /// <param name="categoryTypeList">分类类型列表</param>
        /// <returns></returns>
        bool InsertCategoryType(string dbCode, IList<CLS> categoryTypeList);
        /// <summary>
        /// 插入导航分类列表
        /// </summary>
        /// <param name="dbCode"></param>
        /// <param name="categoryNodeList">分类节点列表</param>
        /// <returns></returns>
        bool InsertCategoryNode(string dbCode, IList<CLS_NODE> categoryNodeList);

        /// <summary>
        /// 插入导航分类列表
        /// </summary>
        /// <param name="dbCode"></param>
        /// <param name="sysid"></param>
        /// <param name="categoryTypeList">分类类型列表</param>
        /// <returns></returns>
        bool UpdateCategoryType(string dbCode, string sysid, Dictionary<string, object> categoryTypeList);

        /// <summary>
        /// 插入导航分类列表
        /// </summary>
        /// <param name="dbCode"></param>
        /// <param name="sysid"></param>
        /// <param name="categoryNodeList">分类节点列表</param>
        /// <returns></returns>
        bool UpdateCategoryNode(string dbCode, string sysid, Dictionary<string, object> categoryNodeList);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="DbCode"></param>
        /// <param name="NaviName"></param>
        /// <param name="NaviValue"></param>
        /// <returns></returns>
        string GetClsNaviName(string DbCode, string NaviName, string NaviValue);

        /// <summary>
        /// 根据code 获取数据库实例
        /// </summary>
        /// <param name="dbCode"></param>
        /// <param name="flage">1,过滤权限 0不过滤任何权限直接查询</param>
        /// <returns></returns>
        SYS_CMS_DATABASE GetDatabase(string dbCode,int flage=1);

        /// <summary>
        /// 
        /// </summary>
        /// <param name="DbCode"></param>
        /// <param name="NaviName"></param>
        /// <returns></returns>
        int GetClsID(string DbCode, string NaviName);
    }
}
